﻿<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>体育中考数据看板</title>
  <link rel="stylesheet" href="css/comon0.css">
</head>

<body>
<div class="loading">
  <div class="loadbox"><img src="images/loading.gif"> 页面加载中...</div>
</div>
<div class="head">
  <h1>体育中考数据看板</h1>
  <div class="weather"><span id="nowTime">2017-12-30</span><span><a
    id="qpid"
    href="public/largeScreen/index.html"
    target="_blank">全屏</a></span>
  </div>
</div>
<div class="mainbox">
  <ul class="clearfix">
    <li>
      <div class="bar" style="margin-bottom: 0.3rem; padding: .15rem;">
        <div class="alltitle">考试总进度</div>
        <div class="barbox">
          <ul class="clearfix">
            <li class="pulll_left counter" id="rss"></li>
            <li class="pulll_left counter" id="yks"></li>
          </ul>
        </div>
        <div class="barbox2">
          <ul class="clearfix">
            <li class="pulll_left">总考生人数</li>
            <li class="pulll_left">考试完成人数</li>

          </ul>
        </div>
      </div>
      <div class="boxall" style="height: 4.1rem">
        <div class="alltitle">项目平均分</div>
        <div class="sy" style="margin-top: 10px; width: 50%;display: none" id="echarts2"></div>
        <div class="sy" style="margin-top: 10px;width: 50%;display: none" id="echarts3"></div>
        <div id="echarts04" style="width: 100%;height:100%"></div>
        <div class="boxfoot"></div>
      </div>
      <div class="sy" style="margin-top: 10px; display: none" id="echarts1"></div>
      <div class="boxall" style="height: 4.1rem">
        <div class="alltitle">考试成绩分布</div>
        <div class="sy" style="margin-top: 10px;" id="echarts11"></div>
        <div class="sy" style="margin-top: 10px;" id="echarts22"></div>
        <div class="sy" style="margin-top: 10px;" id="echarts33"></div>
        <div class="boxfoot"></div>
      </div>
      <div class="boxall" style="height: 4.1rem; display: none">
        <div class="alltitle">验证数</div>
        <div id="echarts5" style="height: 2.2rem; width: 100%;margin-top: 20px;"></div>
        <div class="boxfoot"></div>
      </div>
    </li>
    <li style="width: 72%">
      <div>
        <div class="alltitle">考试计划编排</div>
        <div id="schools" style="text-align: center;">
          <div class="alltitle">学校考试统计</div>
          <div class="wrap" style="height: 9.4rem;">
            <div
              style="color: white;height: 9.4rem; align-content: center;justify-content: center;   position: relative;">
              数据正在统计中...
            </div>
          </div>
          <div class="boxfoot"></div>
        </div>
        <div class="boxall" style="height: 3.2rem;display: none">
          <div class="alltitle">考试总进度</div>
          <div class="" id="echartkszjd" style="width:95%;height: 2.3rem;"></div>
          <div class="boxfoot"></div>
        </div>
        <div class="boxall" style="height:3.2rem ;display: none">
          <div class="alltitle">项目总进度</div>
          <div class="allnav" id="echartxmzjd" style="width:95%;height: 12.0rem;"></div>
          <div class="boxfoot"></div>
        </div>
      </div>
    </li>
    <li>

      <div class="boxall" style="height: 4.1rem;display: none">
        <div class="alltitle">项目进度数</div>
        <div id="echarts4" style="height: 2.2rem; width: 100%;margin-top: 20px;"></div>
        <div class="boxfoot"></div>
      </div>
    </li>
  </ul>

</div>
<div class="back"></div>
<script type="text/javascript" src="js/jquery-2.2.1.min.js"></script>
<script type="text/javascript" src="js/echarts.min.js"></script>
<script type="text/javascript" src="js/jquery.waypoints.min.js"></script>
<script type="text/javascript" src="js/jquery.countup.min.js"></script>
<script language="JavaScript" src="js/js.js"></script>
<script type="text/javascript">
  var urlPath = 'http://' + window.location.host + '/api'
</script>
<!--左边-->
<script type="text/javascript">
  //验证通过率
  var v1 = 0
  var v2 = 0
  var v3 = v1 + v2
  var score = 0.0
  $.ajax({
    url: urlPath + '/business/biz/board/getVerify',
    async: false,
    success: function (res) {
      if (200 == res.code) {
        v1 = res.data.rgs
        v2 = res.data.jqs
        v3 = v1 + v2
        score = res.data.score
      }
    }
  })
  var avgDataName = [];
  var avgDatavalue = [];
  $.ajax({
    url: urlPath + '/business/biz/board/getResultAvg',
    async: false,
    success: function (res) {
      if (200 == res.code) {
        avgDataName = res.data.map(i=>{return i.name})
        avgDatavalue = res.data.map(i=>{return i.avgFraction})
        console.log(avgDataName)
        console.log(avgDatavalue)
      }
    }
  })
  var myChart04 = echarts.init(document.getElementById('echarts04'));
  option04 = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    grid: {
      left: '6%',
      right: '10%',
      bottom: '10%',
      top: '10%',
      containLabel: true
    },
    xAxis: {
      type: 'category',
      data: avgDataName,
      axisLabel: {
        interval: 0,
        rotate: 30,
        textStyle: {
          color: 'white' // 修改文字颜色为红色
        }
      }
    },
    yAxis: {
      type: 'value',
    },
    series: [
      {
        type: 'bar',
        data: avgDatavalue,
        barCategoryGap: '50%',
        label: {
          show: true,
          position: 'top',
          color: 'white', // 修改数字颜色为蓝色
          textStyle: {
            color: 'white' // 修改数字颜色为蓝色
          }
        },
        itemStyle: {
          color: function (param) {
            if(param.name==='1000米/800米'){
              return  '#e55050';
            }
            if(param.name==='仰卧起坐'){
              return  '#cc2020';
            }
            if(param.name==='引体向上'){
              return  '#f34242';
            }
            if(param.name==='排球'){
              return  '#c1dc60';
            }
            if(param.name==='游泳'){
              return  '#731a61';
            }
            if(param.name==='篮球'){
              return  '#5193b7';
            }
            if(param.name==='足球'){
              return  '#51b421';
            }
            if(param.name==='跳绳'){
              return  '#e08bd9';
            }
            if(param.name==='跳远'){
              return  '#e8d438';
            }
            return  '#5470c6';
          }
        }
      }
    ]
  };

  //平均分值
  var myChart1 = echarts.init(document.getElementById('echarts1'))
  option1 = {
    series: [{
      type: 'pie',
      radius: ['70%', '80%'],
      color: '#0088cc',
      label: {
        normal: {
          position: 'center'
        }
      },
      data: [{
        value: score,
        name: '平均分值',
        label: {
          normal: {
            formatter: '0' + score.toString().substring(1, 4) + '',
            textStyle: {
              fontSize: 20,
              color: '#fff'
            }
          }
        }
      }
      ]
    }]
  }
  //机器确认
  var myChart2 = echarts.init(document.getElementById('echarts2'))
  var jqqrbfb = Math.round(v2 / v3 * 100)
  option2 = {
    series: [{
      type: 'pie',
      radius: ['70%', '80%'],
      color: '#fccb00',
      label: {
        normal: {
          position: 'center'
        }
      },
      data: [{
        value: v2,
        name: '机器确认',
        label: {
          show: true,
          normal: {
            formatter: v2 + '',
            textStyle: {
              fontSize: 20,
              color: '#fff'
            }
          }
        }
      }, {
        value: v1,
        name: '人工确认',
        label: {
          show: true,
          normal: {
            formatter: function (params) {
              return '人工确认占比' + jqqrbfb + '%'
            },
            textStyle: {
              color: '#aaa',
              fontSize: 14
            }
          }
        },
        itemStyle: {
          normal: {
            color: 'rgba(255,255,255,.2)'
          },
          emphasis: {
            color: '#fff'
          }
        }
      }]
    }]
  }
  //人工确认
  var myChart3 = echarts.init(document.getElementById('echarts3'))
  var rgqrbfb = Math.round(v1 / v3 * 100)
  option3 = {
    series: [{
      type: 'pie',
      radius: ['70%', '80%'],
      color: '#62b62f',
      label: {
        normal: {
          position: 'center'
        }
      },
      data: [{
        value: v1,
        name: '人工确认',
        label: {
          show: true,
          normal: {
            formatter: v1 + '',
            textStyle: {
              fontSize: 20,
              color: '#fff'
            }
          }
        }
      }, {
        value: v2,
        name: '机器确认',
        label: {
          show: true,
          normal: {
            formatter: function (params) {
              return '机器确认占比' + rgqrbfb + '%'
            },
            textStyle: {
              color: '#aaa',
              fontSize: 14
            }
          }
        },
        itemStyle: {
          normal: {
            color: 'rgba(255,255,255,.2)'
          },
          emphasis: {
            color: '#fff'
          }
        }
      }]
    }]
  }
  setTimeout(function () {
    //myChart1.setOption(option1)
    myChart2.setOption(option2)
    myChart3.setOption(option3)
    myChart04.setOption(option04);
    myChart04.resize();
  }, 1000)
  //验证数
  var myChart5 = echarts.init(document.getElementById('echarts5'))
  var plantCap5 = [
    {
      name: '认证总数',
      value: v3
    }, {
      name: '机器认证数',
      value: v2
    }, {
      name: '人工认证数',
      value: v1
    }, {
      name: '验证平均值',
      value: '0' + score.toString().substring(1, 4) + '%'
    }, {
      name: '机器占比',
      value: jqqrbfb + '%'
    }, {
      name: '人工占比',
      value: rgqrbfb + '%'
    }]
  var datalist5 = [
    {
      offset: [56, 48],
      symbolSize: 110,
      color: 'rgba(73,188,247,.14)'
    }, {
      offset: [30, 70],
      symbolSize: 70,
      color: 'rgba(73,188,247,.14)'
    }, {
      offset: [0, 43],
      symbolSize: 60,
      color: 'rgba(73,188,247,.14)'
    }, {
      offset: [93, 30],
      symbolSize: 70,
      color: 'rgba(73,188,247,.14)'
    }, {
      offset: [26, 19],
      symbolSize: 65,
      color: 'rgba(73,188,247,.14)'
    }, {
      offset: [75, 75],
      symbolSize: 60,
      color: 'rgba(73,188,247,.14)'
    }]
  var datas5 = []
  for (var i = 0; i < plantCap5.length; i++) {
    var item = plantCap5[i]
    var itemToStyle = datalist5[i]
    datas5.push({
      name: item.value + '\n' + item.name,
      value: itemToStyle.offset,
      symbolSize: itemToStyle.symbolSize,
      label: {
        normal: {
          textStyle: {
            fontSize: 14
          }
        }
      },
      itemStyle: {
        normal: {
          color: itemToStyle.color,
          opacity: itemToStyle.opacity
        }
      }
    })
  }
  option5 = {
    grid: {
      show: false,
      top: 10,
      bottom: 10
    },
    xAxis: [{
      gridIndex: 0,
      type: 'value',
      show: false,
      min: 0,
      max: 100,
      nameLocation: 'middle',
      nameGap: 5
    }],
    yAxis: [{
      gridIndex: 0,
      min: 0,
      show: false,
      max: 100,
      nameLocation: 'middle',
      nameGap: 30
    }],
    series: [{
      type: 'scatter',
      symbol: 'circle',
      symbolSize: 120,
      label: {
        normal: {
          show: true,
          formatter: '{b}',
          color: '#FFF',
          textStyle: {
            fontSize: '30'
          }
        }
      },
      itemStyle: {
        normal: {
          color: '#F30'
        }
      },
      data: datas5
    }]
  }
  myChart5.setOption(option5)
</script>
<!--右边-->
<script type="text/javascript">
  //考试成绩分布
  //平均分值
  var myChart11 = echarts.init(document.getElementById('echarts11'))
  var v11 = 0
  var v22 = 0
  var v33 = 0
  $.ajax({
    url: urlPath + '/business/biz/board/getResult',
    async: false,
    success: function (res) {
      if (200 == res.code) {
        v11 = res.data.npjz.toFixed(2)
        v22 = res.data.nvpjz.toFixed(2)
        v33 = res.data.pjz.toFixed(2)
      }
    }
  })
  option11 = {
    series: [{
      type: 'pie',
      radius: ['70%', '80%'],
      color: '#0088cc',
      label: {
        normal: {
          position: 'center'
        }
      },
      data: [
        {
          value: v33,
          name: '总平均值',
          label: {
            normal: {
              formatter: v33 + '',
              textStyle: {
                fontSize: 20,
                color: '#fff'
              }
            }
          }
        },
        {
          value: v33 / 50,
          name: '总平均值',
          label: {
            normal: {
              textStyle: {
                color: '#aaa',
                fontSize: 12
              }
            }
          },
          itemStyle: {
            normal: {
              color: 'rgba(255,255,255,.2)'
            },
            emphasis: {
              color: '#fff'
            }
          }
        }
      ]
    }]
  }
  //男生分值
  var myChart22 = echarts.init(document.getElementById('echarts22'))
  option22 = {
    series: [{
      type: 'pie',
      radius: ['70%', '80%'],
      color: '#fccb00',
      label: {
        normal: {
          position: 'center'
        }
      },
      data: [{
        value: v11,
        name: '女平均值',
        label: {
          normal: {
            formatter: v11 + '',
            textStyle: {
              fontSize: 20,
              color: '#fff'
            }
          }
        }
      }, {
        value: v22 / 50,
        name: '男平均值',
        label: {
          normal: {
            textStyle: {
              color: '#aaa',
              fontSize: 12
            }
          }
        },
        itemStyle: {
          normal: {
            color: 'rgba(255,255,255,.2)'
          },
          emphasis: {
            color: '#fff'
          }
        }
      }]
    }]
  }
  //女生分值
  var myChart33 = echarts.init(document.getElementById('echarts33'))
  option33 = {
    series: [{
      type: 'pie',
      radius: ['70%', '80%'],
      color: '#62b62f',
      label: {
        normal: {
          position: 'center'
        }
      },
      data: [{
        value: v22,
        name: '男平均值',
        label: {
          normal: {
            formatter: v22 + '',
            textStyle: {
              fontSize: 20,
              color: '#fff'
            }
          }
        }
      }, {
        value: v11 / 50,
        name: '女平均值',
        label: {
          normal: {
            textStyle: {
              color: '#aaa',
              fontSize: 12
            }
          }
        },
        itemStyle: {
          normal: {
            color: 'rgba(255,255,255,.2)'
          },
          emphasis: {
            color: '#fff'
          }
        }
      }]
    }]
  }
  //项目进度数
  var myChart4 = echarts.init(document.getElementById('echarts4'))
  var plantCap4 = []
  var projectName = []
  var projectzss = []
  var projectyks = []
  $.ajax({
    url: urlPath + '/business/biz/board/selectCandidateBySchool?time=2022-01-14',
    async: false,
    success: function (res) {
      if (200 == res.code) {
        plantCap4 = res.data.ProjectList
        projectName = res.data.xmzjdList.projectName
        projectzss = res.data.xmzjdList.zss
        projectyks = res.data.xmzjdList.yks
      }
    }
  })
  var datalist4 = [{
    offset: [56, 48],
    symbolSize: 110,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [30, 70],
    symbolSize: 70,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [0, 43],
    symbolSize: 60,
    color: 'rgba(73,188,247,.14)'

  }, {
    offset: [93, 30],
    symbolSize: 70,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [26, 19],
    symbolSize: 65,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [75, 75],
    symbolSize: 60,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [98, 70],
    symbolSize: 60,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [5, 75],
    symbolSize: 60,
    color: 'rgba(73,188,247,.14)'
  }, {
    offset: [65, 10],
    symbolSize: 60,
    color: 'rgba(73,188,247,.14)'
  }]
  var datas4 = []
  for (var i = 0; i < plantCap4.length; i++) {
    var item = plantCap4[i]
    var itemToStyle = datalist4[i]
    datas4.push({
      name: item.value + '\n' + item.name,
      value: itemToStyle.offset,
      symbolSize: itemToStyle.symbolSize,
      label: {
        normal: {
          textStyle: {
            fontSize: 14
          }
        }
      },
      itemStyle: {
        normal: {
          color: itemToStyle.color,
          opacity: itemToStyle.opacity
        }
      }
    })
  }
  option4 = {
    grid: {
      show: false,
      top: 10,
      bottom: 10
    },
    xAxis: [{
      gridIndex: 0,
      type: 'value',
      show: false,
      min: 0,
      max: 100,
      nameLocation: 'middle',
      nameGap: 5
    }],
    yAxis: [{
      gridIndex: 0,
      min: 0,
      show: false,
      max: 100,
      nameLocation: 'middle',
      nameGap: 30
    }],
    series: [{
      type: 'scatter',
      symbol: 'circle',
      symbolSize: 120,
      label: {
        normal: {
          show: true,
          formatter: '{b}',
          color: '#FFF',
          textStyle: {
            fontSize: '30'
          }
        }
      },
      itemStyle: {
        normal: {
          color: '#F30'
        }
      },
      data: datas4
    }]
  }
  setTimeout(function () {
    myChart11.setOption(option11)
    myChart22.setOption(option22)
    myChart33.setOption(option33)
    myChart4.setOption(option4)
  }, 500)
</script>
<!--中间-->
<script>
  //获取考试数量信息
  function selectCandidateNumber() {
    var rssvar = 0
    var yksvar = 0
    $.ajax({
      url: urlPath + '/business/biz/board/selectCandidateNumber',
      async: false,
      success: function (res) {
        if (200 == res.code) {
          rssvar = res.data.rss
          yksvar = res.data.yks
          document.getElementById('rss').innerHTML = rssvar
          document.getElementById('yks').innerHTML = yksvar
        }
      }
    })
    //刷新数字
    $('.counter').countUp()
  }
</script>
<!--考试总进度-->
<script>
  // 考试总进度
  var myChartkszjd = echarts.init(document.getElementById('echartkszjd'))
  myChartkszjd.clear()
  var dataTime = []
  var zrs = []
  var ykrs = []
  $.ajax({
    url: urlPath + '/business/biz/board/selectCandidateNumberByExamDate',
    async: false,
    success: function (res) {
      if (200 == res.code) {
        dataTime = res.data.rqs
        zrs = res.data.zrs
        ykrs = res.data.yks
      }
    }
  })
  optionkszjd = {
    title: {
      text: ''
    },
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data: ['总人数', '已考人数'],
      textStyle: {
        color: '#fff'
      },
      top: '8%'
    },
    grid: {
      top: '40%',
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    color: ['#FF4949', '#FFA74D'],
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: dataTime,
      splitLine: {
        show: false
      },
      axisLine: {
        lineStyle: {
          color: '#fff'
        }
      }
    },
    yAxis: {
      name: '单',
      type: 'value',
      splitLine: {
        show: false
      },
      axisLine: {
        lineStyle: {
          color: '#fff'
        }
      }
    },
    series: [
      {
        name: '总人数',
        type: 'line',
        data: zrs
      },
      {
        name: '已考人数',
        type: 'line',
        data: ykrs
      }
    ]
  }
  myChartkszjd.setOption(optionkszjd)
</script>
<!--项目总进度-->
<script>
  //获取当前日期函数
  function getNowFormatDate() {
    let date = new Date(),
      year = date.getFullYear(), //获取完整的年份(4位)
      month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
      strDate = date.getDate() // 获取当前日(1-31)
    if (month < 10) month = `0${month}` // 如果月份是个位数，在前面补0
    if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数，在前面补0
    return `${year}-${month}-${strDate}`
  }

  // 获取当前时间
  let timeNow = new Date()
  //判断上午还是下午
  let hours = timeNow.getHours()
  var type1 = 0
  if (hours > 11) {
    type1 = 1
  }
  var time1 = getNowFormatDate()
  console.log(time1)
  // 项目总进度
  var myChartxmzjd = echarts.init(document.getElementById('echartxmzjd'))
  myChartxmzjd.clear()
  var projectName = []
  var projectzss = []
  var projectyks = []
  var BizExamProgresss = []
  $.ajax({
    url: urlPath + '/business/biz/board/selectCandidateBySchool?time=' + time1 + '&type=' + type1,
    async: false,
    success: function (res) {
      if (200 == res.code) {
        projectName = res.data.xmzjdList.projectName
        projectzss = res.data.xmzjdList.zss
        projectyks = res.data.xmzjdList.yks
        BizExamProgresss = res.data.BizExamProgress
      }
    }
  })
  console.log(projectName)
  optiontxmzjd = {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'cross',
        crossStyle: {
          color: '#999'
        }
      }
    },
    legend: {
      data: ['总人数', '已考人数'],
      textStyle: {
        color: '#fff'
      }
    },
    color: ['#FF4949', '#FFA74D'],
    xAxis: [
      {
        type: 'category',
        data: projectName,
        axisPointer: {
          type: 'shadow'
        },
        axisLine: {
          lineStyle: {
            color: '#fff'
          }
        }
      }
    ],
    yAxis: [
      {
        type: 'value',
        name: '人数',
        min: 0,
        max: 250,
        interval: 50,
        axisLabel: {
          formatter: '{value}'
        },
        axisLine: {
          lineStyle: {
            color: '#fff'
          }
        }
      }
    ],
    series: [
      {
        name: '总人数',
        type: 'bar',
        tooltip: {
          valueFormatter: function (value) {
            return value
          }
        },
        data: projectzss
      },
      {
        name: '已考人数',
        type: 'bar',
        tooltip: {
          valueFormatter: function (value) {
            return value
          }
        },
        data: projectyks
      }
    ]
  }
  myChartxmzjd.setOption(optiontxmzjd)
  var schools = document.getElementById('schools')
  var html1 = ''
  //添加学校列表
  console.log(BizExamProgresss)
  if (BizExamProgresss.length > 0) {
    for (var i = 0; i < BizExamProgresss.length; i++) {
      if (i % 2 == 0) {
        html1 += '<div class="boxall" style=" float: left; width: 6.9rem; margin-left: 0.05rem;">\n'
      } else {
        html1 += ' <div class="boxall" style=" float: left; width: 6.9rem; margin-left: 0.1rem;">'
      }
      html1 += '      <div class="alltitle">' + BizExamProgresss[i].zxmc + '</div>\n' +
        '      <div class="wrap" style="height: 4.08rem;">\n' +
        '        <ul>\n'
      var projectList = BizExamProgresss[i].projectList
      for (var j = 0; j < projectList.length; j++) {
        var zb = projectList[j].yknum / projectList[j].total
        zb = Number.isNaN(zb) ? 0 : zb
        console.log(zb)
        zb = zb * 100
        html1 +=
          '          <li>\n' +
          '            <p>' + projectList[j].projectname + '项目；总人数：' + projectList[j].total + '；已考人数：' + projectList[j].yknum + '；占比：<span style="color: green">' + zb.toFixed(2) + '% </span></p>\n' +
          '          </li>\n'
      }
      html1 += '        </ul>\n' +
        '      </div>\n' +
        '      <div class="boxfoot"></div>\n' +
        '    </div>'
    }
  } else {
    html1 += '<div class="boxall" style=" float: left;width: 99%;margin-left: 0.05rem;">\n'
    html1 +=
      '      <div class="alltitle">学校考试统计</div>\n' +
      '      <div class="wrap" style="height: 9.4rem;">\n' +
      '      <div style="color: white;height: 9.4rem; align-content: center;justify-content: center;   position: relative;">数据正在统计中...</div>' +
      '      </div>\n' +
      '      <div class="boxfoot"></div>\n' +
      '    </div>'
  }
  schools.innerHTML = html1
</script>
<!--渲染操作-->
<script type="text/javascript">
  $(document).ready(function () {
    document.getElementById('qpid').href = 'http://' + window.location.host + '/largeScreen/index.html'
    myChart1.resize()
    myChart2.resize()
    myChart3.resize()
    myChart5.resize()
    myChart11.resize()
    myChart22.resize()
    myChart33.resize()
    myChart4.resize()
    myChartkszjd.resize()
    selectCandidateNumber()
  })
  window.addEventListener('resize', function () {
    myChart1.resize()
    myChart2.resize()
    myChart3.resize()
    myChart5.resize()
    myChart11.resize()
    myChart22.resize()
    myChart33.resize()
    myChart4.resize()
    myChartkszjd.resize()
    selectCandidateNumber()
  })
</script>
<!--时间信息-->
<script type="text/javascript">
  $(document).ready(function () {
    // var html = $('.wrap ul').html()
    // for (var v = 0; v < 10; v++) {
    //   $('.wrap ul').append(html)
    // }
    // var ls = $('.wrap li').length / 2 + 1
    // i = 0
    // ref = setInterval(function () {
    //   i++
    //   if (i == ls) {
    //     i = 1
    //     $('.wrap ul').css({marginTop: 0})
    //     $('.wrap ul').animate({marginTop: -'.52' * i + 'rem'}, 1000)
    //   }
    //   $('.wrap ul').animate({marginTop: -'.52' * i + 'rem'}, 1000)
    // }, 2400)
    var html2 = $('.adduser ul').html()
    $('.adduser ul').append(html2)
    var ls2 = $('.adduser li').length / 2 + 1
    a = 0
    ref = setInterval(function () {
      a++
      if (a == ls2) {
        a = 1
        $('.adduser ul').css({marginTop: 0})
        $('.adduser ul').animate({marginTop: -'.5' * a + 'rem'}, 800)
      }
      $('.adduser ul').animate({marginTop: -'.5' * a + 'rem'}, 800)
    }, 4300)
    document.getElementById('nowTime').innerHTML = CurentTime()
    temp = setInterval(function () {
      document.getElementById('nowTime').innerHTML = CurentTime()
    }, 1000);

    scoreCarousel($('.boxall .wrap'), 2400);
    swiperItems($('#schools .boxall'), 4, 30000);

    function swiperItems(items, pageSize, interval) {
      if(items.length <= pageSize) {
        return
      }
      var curPage = 1;
      var totalCount = items.length;
      var totalPage = Math.ceil(totalCount / pageSize);

      function setCurItemDisplay() {
        items.hide();

        // 计算当前页的起始索引和结束索引
        var startIndex = (curPage - 1) * pageSize;
        var endIndex = Math.min(startIndex + pageSize, totalCount);
        // 显示当前页的项
        items.slice(startIndex, endIndex).fadeIn();

        if(++curPage > totalPage){
          curPage = 1;
        }
      }

      setCurItemDisplay();
      setInterval(setCurItemDisplay, interval);
    }
    // 考试记录轮播
    function scoreCarousel(container, interval ) {
      if(container instanceof $){
        return container.each(function (index, item) {
          scoreCarousel(item, interval)
        })
      }
      var $container = $(container);
      var $noticeContent = $container.find('ul'); // 获取公告内容容器
      var itemHeight = $noticeContent.children().first().outerHeight(true); //单个元素高度
      var count = $noticeContent.children().length;
      var currentTop = 0; // 当前滚动距离

      // 复制公告内容，实现无缝滚动
      $noticeContent.append($noticeContent.html());

      // 开始滚动
      setInterval(function() {
        currentTop -= itemHeight; // 更新滚动距离
        $noticeContent.animate({ marginTop: currentTop }, 1000, function() {
          // 如果滚动超出容器高度，重置滚动距离
          if (-currentTop >= itemHeight * count) {
            currentTop = 0;
            $noticeContent.css({ marginTop: currentTop });
          }
        });
      }, interval);

    }
  })

  function CurentTime() {
    var now = new Date()
    var year = now.getFullYear()       //年
    var month = now.getMonth() + 1     //月
    var day = now.getDate()            //日
    var hh = now.getHours()            //时
    var mm = now.getMinutes()          //分
    var ss = now.getSeconds()          //秒
    var clock = year + '-'
    if (month < 10) {
      clock += '0'
    }
    clock += month + '-'
    if (day < 10) {
      clock += '0'
    }
    clock += day + ' '
    if (hh < 10) {
      clock += '0'
    }
    clock += hh + ':'
    if (mm < 10) clock += '0'
    clock += mm + ':'
    clock += ss
    return (clock)
  }
</script>
</body>
</html>
